﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.DirectoryServices;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;

public partial class Manager_Admin_ADsTest : System.Web.UI.Page {
	protected void Page_Load(object sender, EventArgs e) {
		DirectoryEntry deAdmins = Dimok.Data.ADs.LDAP.FindGroup("OU=_Groups,OU=MotoBank,OU=Web", "Admins");
		DirectoryEntry deCommon = Dimok.Data.ADs.LDAP.FindGroup("OU=_Groups,OU=MotoBank,OU=Web", "_Common");
		Response.Write(deAdmins.Path + "<BR>");
		Response.Write(deCommon.Path);
		PropertyValueCollection members = deCommon.Properties["Member"];
		string groupDN = deAdmins.Properties["distinguishedName"].Value + "";
		members.Add(groupDN);
		deCommon.CommitChanges();
	}
}
